class MyBlockingQueue{
    private String[] array=null;
    public MyBlockingQueue(int size){
        array=new String[size];
    }
    private Object locker=new Object();
    private int head;
    private int tail;
    private int size;
    public void put(String elem){
        if(size>= array.length){
            //队列满了
            //后续需要让这个代码能够阻塞
            return ;
        }
        synchronized (locker){
            //将新的元素放到fail的位置上
            array[tail]=elem;
            tail++;
            if(tail>=array.length){
                tail=0;
            }
            size++;
        }
    }
}
public class Test14 {
    public static void main(String[] args) {

    }
}
